<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
    <script type="text/javascript" src="/javascripts/xheditor/jquery/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="/javascripts/xheditor/xheditor-1.2.2.min.js"></script>
    <script type="text/javascript" src="/javascripts/xheditor/xheditor_lang/zh-cn.js"></script>
  </head>
  <body>
    <%- include header %>
   <%= title %>

   <table border="1">
    <tr>
      <td>id</td>
      <td>title</td>
      <td>content</td>
    </tr>

  <% list.forEach(function(item,index){ %>
  <tr>
      <td> <%= item._id %></td>
      <td> <%= item.title %></td>
      <td> <%- item.content %></td>
    </tr>
 <% }) %>

 <tr>
  <td colspan="3">
    <a href="/comment?pageNo=1">首页</a>
    <a href="/comment?pageNo=<%= pageNo> 1 ? parseInt(pageNo)-1:1 %>">上一页</a>
    <a href="/comment?pageNo=<%= pageNo< totalPages ? parseInt(pageNo)+1:totalPages %>">下一页</a>
    <a href="/comment?pageNo=<%= totalPages %>">尾页</a>
  </td>
 </tr>
  </table>


   <form action="/comment/submit" method="post">
        标题：<input type="text" name="title">
        <br/>
        内容：<textarea cols="120" rows="30" id="content" name="content"></textarea>
        <br/>
        <input type="submit" value="提交">
   </form>
<script type="text/javascript">
$(pageInit);
function pageInit()
{
	// $.extend(XHEDITOR.settings,{shortcuts:{'ctrl+enter':submitForm}});
	$('#content').xheditor({
        html5Upload: false,
        upMultiple:1,


        upLinkUrl:"/upload.php",
        upLinkExt:"zip,rar,txt",

        upImgUrl:"/uploadImg",
        upImgExt:"jpg,jpeg,gif,png",
        
        upFlashUrl:"upload.php",
        upFlashExt:"swf",
        
        upMediaUrl:"upload.php",
        upMediaExt:"wmv,avi,wma,mp3,mid"
        });
}
</script>
  </body>
</html>
